<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="com.crm.util.RequestEx"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>  
    <title>CRM客户管理</title>
    <link rel="icon" mce_href="<%=path%>/images/title_logo.ico" href="<%=path%>/images/title_logo.ico" type="image/x-ico"/>
    <link rel="shortcut icon" mce_href="<%=path%>/images/title_logo.ico" href="<%=path%>/images/title_logo.ico" type="image/x-ico"/>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>	
	<link rel="stylesheet" type="text/css" href="<%=path%>/css/login.css">
	<script type="text/javascript" src="<%=path%>/js/easyui1.3.2/jquery-1.8.0.min.js"></script>
	<script type="text/javascript">	
		function doLogin(){
			var username = document.getElementById("username").value;
			var pwd = document.getElementById("pwd").value;
			$.ajax({
				url: '<%=path%>/none/login_check.jsp',
				type : 'POST',
				data : {username : username, pwd : pwd},
				success : function(data) {
					if('ok' == data){
						window.location.href = "<%=path%>/jsp/main.jsp";
					}else{
						document.getElementById("loginMsg").innerText = data;
					}	
				},
				error : function() {
					document.getElementById("loginMsg").innerText = "登录出现错误，请检查您的系统。";
				}
			});
		}

		function init(){
			document.getElementById("username").focus();
			document.onkeydown = function(e){ 
			    var ev = document.all ? window.event : e;
			    if(ev.keyCode==13){
			    	document.getElementById("username");
					var pwd = document.getElementById("pwd");
					if('username' == document.activeElement.id){
						pwd.focus();
					}else if('pwd' == document.activeElement.id){
						doLogin();
					}
			    }
			}
		}
	</script>
  </head>
  
  <body class="bg_body" onload="javascript:init();">
    <div class="bg_div"><img id="bgimg" src="../images/bg_login.jpg" width="100%" height="100%"/></div>
   	<table border="0" bordercolor="red" cellpadding="0" cellspacing="0" width="100%" height="100%">
		<tr>
   			<td colspan="3">&nbsp;</td>
   		</tr>
   		<tr >
   			<td>&nbsp;</td>
   			<td width="594px" height="353px" class="bg_center">
	   			<table border="0" bordercolor="red" cellpadding="0" cellspacing="0" width="574px" height="333px">
			   		<tr>
			   			<td width="45%">&nbsp;</td>
			   			<td width="55%">&nbsp;</td>
			   		</tr>
			   		<tr height="260px">
			   			<td>&nbsp;</td>
			   			<td>
				   			<table border="0" bordercolor="red" cellpadding="0" cellspacing="0" width="300px" height="100%">
								<tr height="75px" align="center" style="text-align:center;">
						   			<td colspan="3">
						   				
						   			</td>
						   		</tr>
						   		<tr height="35px">
						   			<td width="70px" align="right" style="text-align:right;padding-right:10px">
						   				<span style="font-weight:bold;color:#006600;font-size:14px">
						   				用户名
						   				</span>
						   			</td>
						   			<td width="150px">
						   				<input style="width:140px" type="text" id="username" name="username" value=""/>
						   			</td>
						   			<td rowspan="2">
						   				<img id="bgimg" src="../images/button_login.png" width="90px" height="62px" onClick="javascript:doLogin()"/>
						   			</td>
						   		</tr>
						   		<tr height="35px">
						   			<td align="right" style="text-align:right;padding-right:10px">
						   				<span style="font-weight:bold;color:#006600;font-size:14px">
						   				密码
						   				</span>
						   			</td>
						   			<td>
						   				<input style="width:140px" type="password" id="pwd" name="pwd" value=""/>
						   			</td>
						   		</tr>
						   		<tr height="35px" >
						   			<td colspan="3" style="padding-left:22px">
						   				<span id="loginMsg" style="color:red;font-size:13px"></span>
						   			</td>
						   		</tr>
						   		<tr height="40px" >
						   			<td colspan="3">
						   				&nbsp;
						   			</td>
						   		</tr>
						   	</table>
			   			</td>
			   		</tr>
			   	</table>
   			</td>
   			<td>&nbsp;</td>
   		</tr>
   		<tr>
   			<td colspan="3">&nbsp;</td>
   		</tr>
   	</table>
  </body>
</html>
